<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../../../resources/layui/css/layui.css"/>

		<style type="text/css">
			.btn-success,.btn-warning{padding: 3px 10px;margin: 0 5px;}

			.cover-box{
				position: fixed;
				left: 0;
				top: 0;
				right: 0;
				bottom: 0;
				background-color: #ccc;
				z-index: 400;

				-webkit-transition: transform .5s ease;
				transition: transform .5s ease;

				-webkit-transform: translateX(100%);
				transform: translateX(100%);
			}
			.cover-box.active{
				-webkit-transform: translateX(0%);
				transform: translateX(0%);
			}
		</style>
	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"><a href="javascript:;" onclick="location.href='../../../word.html'"><span class="iconfont icon-fanhui"></span></a></div>
				<div class="col-xs-8"><h2>材料供应单签收管理</h2></div>
				<div class="col-xs-2 text-right"><a href="javascript:;"><span class="iconfont icon-31sousuo sousuo"></span></a></div>
			</div>
			<div class="row">
				<dl id="list" class="erp-list">

				</dl>
                <div class="showlists">暂无更多数据</div>
            </div>
			<!--搜索-->
			<div class="search-box">
				<div class="search-cover">
					<form action="" method="post">
						<div class="row">
							<div class="col-xs-4">
								<ul class="list-group list-items">
								  <li class="list-group-item list-group-lists search-active">项目名称</li>
								  <li class="list-group-item list-group-lists">开始时间</li>
								  <li class="list-group-item list-group-lists">结束时间</li>
								</ul>
							</div>
							<div class="col-xs-8">
								<div class="search-lists search-list1 search-active">
									<input type="text" id="mname" class="pro pro-input pro-name" placeholder="请输入项目名称"/>
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="date1" name="supply_Time" placeholder="请输入开始时间">
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="date2" name="supply_Time" placeholder="请输入结束时间">
								</div>
							</div>
						</div>
						<div class="row">
							<span class="btns close-cover">取消</span>
                            <input class="sub-cover btns fr" type="button"  value="确定" />
                        </div>
					</form>
				</div>
			</div>
		</div>
		<div class="cover-box">
			<p class="back">《返回</p>

			<ul>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
				<li>姓名：笑小华</li>
			</ul>
		</div>

	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/jquery.jedate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js"></script>
<script src="../../../../resources/layui/layui.js"></script>

<script>
    layui.use('laydate', function() {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#date1'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#date2'
            ,type: 'datetime'
        });
    })


	$(".sousuo").click(function(){
		$(".search-box").slideToggle();
	})
	$(".list-group-lists").click(function(){
		var i=$(this).index();
		$(".search-lists").hide();
		$(".search-lists").eq(i).show();
		$(".list-group-lists").removeClass("search-active");
		$(this).addClass("search-active");
		$(".pros").hide();
		$(".pros").eq(i).show();

	});

//	点击取消按钮
	$(".close-cover").click(function(){
		$(".search-box").slideUp();
	});
//	点击确定按钮
	$(".sub-cover").click(function(){
		$(".search-box").slideUp();
        $('#list').html('');
        formData.mname=$('#mname').val();
        formData.begintime=$('#date1').val();
        formData.endtime=$('#date2').val();
        nloader.search();
    });

        var formData = {
            type:'a'
        };
        //滚动加载
        var nloader = LoadMore({
            api: 'api/supply/suppSignMana.do',
            data: formData,
            success: function (data) {
                var data = data.data;
                console.log(data)
                jsondata = data;
                var html = '';
                for (var i=0;i<data.length;i++){
                    var model = '<dd><a href="erp-details.html?rm_Code='+data[i].rm_Code+'&&validate='+data[i].validate+'" ><h3><span class="btn btn-danger fr">{{validate}}</span>' +
                        data[i].rm_Code +
                        '</h3>' +
                        '<div class="erp-txt visa-txt">' +
                        '<p><span  class="sp">项目名称:</span><span class="divCon">'+data[i].proName+'</span></p>' +
                        '<p><span  class="sp">施工单位:</span><span class="divCon">'+data[i].compName1+'</span></p>' +
                        '<p><span  class="sp">供货地址:</span><span class="divCon">'+data[i].r_adr+'</span></p>' +
                        '<p><span>供货时间:</span>'+isun(data[i].rm_Time)+'</p>' +
//                      '<p><span>签收状态:</span>{{validate}}</p>' +
                        '</div>' +
                        '</a>' +
                        '</dd>';
                    if(data[i].validate == -1){
                        model = model.replace('{{validate}}','等待签收');
                    }
                    if(data[i].validate == 0){
                        model = model.replace('{{validate}}','已签收');
                    }else {
                        model = model.replace('{{validate}}','拒绝签收');
                    }
                    html += model;
                }
                $('#list').html($('#list').html()+html);
            }
        })

    $('.cover-box').find('.back').click(function () {
        $('.cover-box').removeClass('active');
    })


    function open(i) {
        sessionStorage.setItem('lhr_clxqgl',JSON.stringify(jsondata[i]));
        location.href = 'erp-details.html';
    }
//    gundong(function(){
//        var n=1;
//        data(n,10);
//    }());

    function isun(data) {
		if (data == undefined){
		    return '';
		}
		return data;
    }


</script>










